﻿using com.ruovea.utilty;
using com.ruovea.utilty.rstring;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GogsWeb.Api.Builde
{
    /// <summary>
    /// 页面index
    /// </summary>
    public class ViewIndex
    {
        /// <summary>
        /// 初始化
        /// </summary>
        public static void Init()
        {
            SqlSugar.SqlSugarClient sc = new SqlSugar.SqlSugarClient(new SqlSugar.ConnectionConfig { ConnectionString = "Data Source=gogs.db", DbType = SqlSugar.DbType.Sqlite });
            var list = sc.DbMaintenance.GetTableInfoList();
            foreach (var t in list)
            {
                List<DbColumnInfo> dbColumns = sc.DbMaintenance.GetColumnInfosByTableName(t.Name);
                string modeName = Str.ToCamelAny(t.Name);
                string bodyStr = body(modeName, dbColumns);
                com.ruovea.vfile.FileHelper.CreateFile($"BuildeFile/Vue/{modeName}.vue", bodyStr.GetBytes());
            }
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="modeName"></param>
        /// <param name="dbColumns"></param>
        /// <returns></returns>
        public static string body(string modeName, List<DbColumnInfo> dbColumns)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("<template>");
            sb.AppendLine("  <div>");
            sb.AppendLine("    <Collapse simple>");
            sb.AppendLine("      <Panel name=\"1\">");
            sb.AppendLine("        <span> 查询 </span>                                                                                          ");
            sb.AppendLine("        <p slot=\"content\">                                                                                         ");

            sb.AppendLine("          <Row :gutter=\"16\">                                                                                       ");

            List<DbColumnInfo> columns = dbColumns.Where(x => x.IsPrimarykey == false).ToList();

            int i = 1;
            foreach (var x in columns)
            {
                sb.AppendLine("            <Col :xs=\"12\" :sm=\"8\" :md=\"8\" :lg=\"6\">                                                           ");
                sb.AppendLine("              <Input>                                                                                                ");
                sb.AppendLine($"                <span slot=\"prepend\">{Str.ToCamelAny(x.DbColumnName)}</span>                                      ");
                sb.AppendLine("              </Input>                                                                                               ");
                sb.AppendLine("            </Col>                                                                                                   ");


                if (i % 4 == 0)
                {
                    sb.AppendLine("          </Row>                                                                                                     ");
                    sb.AppendLine("                                                                                                                     ");
                    sb.AppendLine("          <Row :gutter=\"16\">                                                                                       ");
                }


                i++;
            }


            //sb.AppendLine("            <Col :xs=\"12\" :sm=\"8\" :md=\"8\" :lg=\"6\">                                                           ");
            //sb.AppendLine("              <Input>                                                                                                ");
            //sb.AppendLine("                <span slot=\"prepend\">http://</span>                                                                ");
            //sb.AppendLine("              </Input>                                                                                               ");
            //sb.AppendLine("            </Col>                                                                                                   ");
            //sb.AppendLine("            <Col :xs=\"12\" :sm=\"8\" :md=\"8\" :lg=\"6\">                                                           ");
            //sb.AppendLine("              <Input>                                                                                                ");
            //sb.AppendLine("                <span slot=\"prepend\">http://</span>                                                                ");
            //sb.AppendLine("              </Input>                                                                                               ");
            //sb.AppendLine("            </Col>                                                                                                   ");
            //sb.AppendLine("            <Col :xs=\"12\" :sm=\"8\" :md=\"8\" :lg=\"6\">                                                           ");
            //sb.AppendLine("              <Input>                                                                                                ");
            //sb.AppendLine("                <span slot=\"prepend\">http://</span>                                                                ");
            //sb.AppendLine("              </Input>                                                                                               ");
            //sb.AppendLine("            </Col>                                                                                                   ");


            //sb.AppendLine("          </Row>                                                                                                     ");
            //sb.AppendLine("                                                                                                                     ");
            //sb.AppendLine("          <Row :gutter=\"16\">                                                                                       ");


            //sb.AppendLine("            <Col :xs=\"12\" :sm=\"8\" :md=\"8\" :lg=\"6\">                                                           ");
            //sb.AppendLine("              <Input>                                                                                                ");
            //sb.AppendLine("                <span slot=\"prepend\">http://</span>                                                                ");
            //sb.AppendLine("              </Input>                                                                                               ");
            //sb.AppendLine("            </Col>                                                                                                   ");
            //sb.AppendLine("            <Col :xs=\"12\" :sm=\"8\" :md=\"8\" :lg=\"6\">                                                           ");
            //sb.AppendLine("              <Input>                                                                                                ");
            //sb.AppendLine("                <span slot=\"prepend\">http://</span>                                                                ");
            //sb.AppendLine("              </Input>                                                                                               ");
            //sb.AppendLine("            </Col>                                                                                                   ");
            //sb.AppendLine("            <Col :xs=\"12\" :sm=\"8\" :md=\"8\" :lg=\"6\">                                                           ");
            //sb.AppendLine("              <Input>                                                                                                ");
            //sb.AppendLine("                <span slot=\"prepend\">http://</span>                                                                ");
            //sb.AppendLine("              </Input>                                                                                               ");
            //sb.AppendLine("            </Col>                                                                                                   ");
            //sb.AppendLine("            <Col :xs=\"12\" :sm=\"8\" :md=\"8\" :lg=\"6\">                                                           ");
            //sb.AppendLine("              <Input>                                                                                                ");
            //sb.AppendLine("                <span slot=\"prepend\">http://</span>                                                                ");
            //sb.AppendLine("              </Input>                                                                                               ");
            //sb.AppendLine("            </Col>                                                                                                   ");

            sb.AppendLine("          </Row>                                                                                                     ");

            sb.AppendLine("                                                                                                                     ");
            sb.AppendLine("          <Row :gutter=\"16\" class=\"btngrop\">                                                                     ");
            sb.AppendLine("            <Button type=\"success\" icon=\"ios-search\">查询</Button>                                               ");
            sb.AppendLine("            <Button type=\"primary\" icon=\"md-refresh\" class=\"ml10\">重置</Button>                                ");
            sb.AppendLine("          </Row>                                                                                                     ");
            sb.AppendLine("        </p>                                                                                                         ");
            sb.AppendLine("      </Panel>                                                                                                       ");
            sb.AppendLine("    </Collapse>                                                                                                      ");
            sb.AppendLine("                                                                                                                     ");
            sb.AppendLine("    <div class=\"card\">                                                                                             ");
            sb.AppendLine("      <div class=\"mb10\">                                                                                           ");
            sb.AppendLine("        <Button type=\"success\" @click=\"addFrom\">添加</Button>                                                    ");
            sb.AppendLine("      </div>                                                                                                         ");
            sb.AppendLine("      <Table                                                                                                         ");
            sb.AppendLine("        border                                                                                                       ");
            sb.AppendLine("        :columns=\"tablecolumns\"                                                                                    ");
            sb.AppendLine("        :data=\"tabledata\"                                                                                          ");
            sb.AppendLine("        :loading=\"loading\"                                                                                         ");
            sb.AppendLine("        :show-header=\"true\"                                                                                        ");
            sb.AppendLine("        :show-context-menu=\"true\"                                                                                  ");
            sb.AppendLine("        @on-row-dblclick=\"dblclick\"                                                                                ");
            sb.AppendLine("      >                                                                                                              ");
            sb.AppendLine("        <template slot-scope=\"{ row, index }\" slot=\"action\">                                                     ");
            sb.AppendLine("          <Tooltip content=\"查看\" placement=\"bottom-start\" :transfer=\"true\">                                   ");
            sb.AppendLine("            <Button size=\"small\" @click=\"dblclick(row)\"                                                        ");
            sb.AppendLine("              ><Icon type=\"md-eye\"                                                                                 ");
            sb.AppendLine("            /></Button>                                                                                              ");
            sb.AppendLine("          </Tooltip>                                                                                                 ");
            sb.AppendLine("                                                                                                                     ");
            sb.AppendLine("          <Tooltip content=\"编辑\" placement=\"bottom-start\" :transfer=\"true\">                                   ");
            sb.AppendLine("            <Button                                                                                                  ");
            sb.AppendLine("              type=\"primary\"                                                                                       ");
            sb.AppendLine("              size=\"small\"                                                                                         ");
            sb.AppendLine("              class=\"ml5\"                                                                                          ");
            sb.AppendLine("              @click=\"editFrom(index)\"                                                                             ");
            sb.AppendLine("              ><Icon type=\"md-create\"                                                                              ");
            sb.AppendLine("            /></Button>                                                                                              ");
            sb.AppendLine("          </Tooltip>                                                                                                 ");
            sb.AppendLine("                                                                                                                     ");
            sb.AppendLine("          <Tooltip content=\"删除\" placement=\"bottom-start\" :transfer=\"true\">                                   ");
            sb.AppendLine("            <Poptip :transfer=\"true\" :confirm=\"true\" @on-ok=\"remove(index)\">                                   ");
            sb.AppendLine("              <Button type=\"error\" size=\"small\" class=\"ml5\"                                                    ");
            sb.AppendLine("                ><Icon type=\"md-trash\"                                                                             ");
            sb.AppendLine("              /></Button>                                                                                            ");
            sb.AppendLine("              <div slot=\"title\"><i>确定删除吗?</i></div>                                                           ");
            sb.AppendLine("              <div slot=\"content\">                                                                                 ");
            sb.AppendLine("                <a @click=\"remove(index)\">删除</a>                                                                 ");
            sb.AppendLine("              </div>                                                                                                 ");
            sb.AppendLine("            </Poptip>                                                                                                ");
            sb.AppendLine("          </Tooltip>                                                                                                 ");
            sb.AppendLine("        </template>                                                                                                  ");
            sb.AppendLine("      </Table>                                                                                                       ");
            sb.AppendLine("      <br />                                                                                                         ");
            sb.AppendLine("      <Page                                                                                                          ");
            sb.AppendLine("        :total=\"totals\"                                                                                            ");
            sb.AppendLine("        :page-size=\"pageSize\"                                                                                      ");
            sb.AppendLine("        show-sizer                                                                                                   ");
            sb.AppendLine("        show-total                                                                                                   ");
            sb.AppendLine("        show-elevator                                                                                                ");
            sb.AppendLine("        @on-change=\"changePage\"                                                                                    ");
            sb.AppendLine("        @on-page-size-change=\"onSize\"                                                                              ");
            sb.AppendLine("        :page-size-opts=\"[15, 25, 50, 80]\"                                                                         ");
            sb.AppendLine("      />                                                                                                             ");
            sb.AppendLine("    </div>                                                                                                           ");
            sb.AppendLine("    <EditModal                                                                                                       ");
            sb.AppendLine("      :baseuri=\"baseuri\"                                                                                           ");
            sb.AppendLine("      :title=\"mprops.title\"                                                                                        ");
            sb.AppendLine("      :isshowmodal=\"showmodal\"                                                                                     ");
            sb.AppendLine("      :index=\"mprops.index\"                                                                                        ");
            sb.AppendLine("      :hidefooter=\"mprops.hidefooter\"                                                                              ");
            sb.AppendLine("      :width=\"mprops.width\"                                                                                        ");
            sb.AppendLine("      :keyId=\"mprops.keyId\"                                                                                        ");
            sb.AppendLine("      :tablekey=\"tablekey\"                                                                                        ");
            sb.AppendLine("      @on-close=\"modalCancel\"                                                                                      ");
            sb.AppendLine("    ></EditModal>                                                                                                    ");
            sb.AppendLine("  </div>                                                                                                             ");
            sb.AppendLine("</template>                                                                                                          ");
            sb.AppendLine("                                                                                                                     ");
            sb.AppendLine("<script>                                                                                                             ");
            sb.AppendLine("import axios from \"@/libs/api.request\";                                                                            ");
            sb.AppendLine($"import EditModal from \"./{modeName}Edit\"; // 数据源列表                                                              ");

            if (columns.Where(x => x.DbColumnName.LastIndexOf("unix") > 0).Count() > 0)
            {
                sb.AppendLine("import { getDateTime } from \"@/libs/tools\";                                                              ");
            }

            sb.AppendLine("export default {                                                                                                     ");
            sb.AppendLine("  components: { EditModal },                                                                                         ");
            sb.AppendLine("  data() {                                                                                                           ");
            sb.AppendLine("    return {                                                                                                         ");
            sb.AppendLine($"      baseuri: \"/api/{modeName}\",                                                                                    ");
            sb.AppendLine("      currentPage: 1,                                                                                                ");
            sb.AppendLine("      pageSize: 15,                                                                                                  ");
            sb.AppendLine("      totals: 0,                                                                                                     ");
            sb.AppendLine("                                                                                                                     ");
            sb.AppendLine("      loading: false,                                                                                                ");

            sb.AppendLine("      tabledata: [],                                                                                                 ");
            sb.AppendLine($"      tablekey: \"{dbColumns.Where(x => x.IsPrimarykey).Select(x => Str.ToCamelAny(x.DbColumnName)).FirstOrDefault()}\",                                                                                              ");
            sb.AppendLine("      tablecolumns: [                                                                                                ");
            sb.AppendLine("        { title: \"序号\", type: \"index\", width: 65, align: \"center\" },                                          ");
            


            foreach (var x in columns)
            {
                if (x.DbColumnName.Contains("unix"))
                {
                    sb.AppendLine("        { title: \"" + Str.ToCamelAny(x.DbColumnName) + "\", key: \"" + Str.ToCamelAny(x.DbColumnName) + "\", minWidth: 165, resizable:true, tooltip: true , render: (h, params) => { return h(\"div\", getDateTime(params.row." + Str.ToCamelAny(x.DbColumnName) + ", \"year\")); },},                                                  ");
                }
                else
                {
                    sb.AppendLine("        { title: \"" + Str.ToCamelAny(x.DbColumnName) + "\", key: \"" + Str.ToCamelAny(x.DbColumnName) + "\", minWidth: 95, resizable:true, tooltip: true },                                                                      ");
                }
            }
            //sb.AppendLine("        { title: \"id\", width: 80, key: \"Id\" },                                                                   ");
            //sb.AppendLine("        { title: \"orgId\", key: \"OrgId\" },                                                                        ");
            //sb.AppendLine("        { title: \"teamId\", key: \"TeamId\" },                                                                      ");
            //sb.AppendLine("        { title: \"repoId\", key: \"RepoId\" },                                                                      ");

            sb.AppendLine("        {                                                                                                            ");
            sb.AppendLine("          title: \"操作\",                                                                                           ");
            sb.AppendLine("          slot: \"action\",                                                                                          ");
            sb.AppendLine("          fixed: \"right\",                                                                                          ");
            sb.AppendLine("          width: 140,                                                                                                ");
            sb.AppendLine("          align: \"center\",                                                                                         ");
            sb.AppendLine("        },                                                                                                           ");
            sb.AppendLine("      ],                                                                                                             ");
            sb.AppendLine("                                                                                                                     ");
            sb.AppendLine("      showmodal: false,                                                                                              ");
            sb.AppendLine("      mprops: {                                                                                                      ");
            sb.AppendLine("        title: \"\",                                                                                                 ");
            sb.AppendLine("        hidefooter: false,                                                                                           ");
            sb.AppendLine("        keyId: \"\",                                                                                                 ");
            sb.AppendLine("        index: -1,                                                                                                   ");
            sb.AppendLine("      },                                                                                                             ");
            sb.AppendLine("    };                                                                                                               ");
            sb.AppendLine("  },                                                                                                                 ");
            sb.AppendLine("  created() {                                                                                                        ");
            sb.AppendLine("    this.initdata();                                                                                                 ");
            sb.AppendLine("  },                                                                                                                 ");
            sb.AppendLine("  inject: [\"reload\"],                                                                                              ");
            sb.AppendLine("  methods: {                                                                                                         ");
            sb.AppendLine("    exportCsv(params) {                                                                                              ");
            sb.AppendLine("      this.$refs.tablesMain.exportCsv(params);                                                                       ");
            sb.AppendLine("    },                                                                                                               ");
            sb.AppendLine("    dblclick(row) {                                                                                                  ");
            sb.AppendLine("      this.showmodal = true;                                                                                         ");
            sb.AppendLine("      this.mprops.title = \"查看\";                                                                                  ");
            sb.AppendLine("      this.mprops.hidefooter = true;                                                                                 ");
            sb.AppendLine("      this.mprops.keyId = row[this.tablekey];                                                                        ");
            sb.AppendLine("    },                                                                                                               ");
            sb.AppendLine("    changePage(page) {                                                                                               ");
            sb.AppendLine("      if (this.currentPage != page) {                                                                                ");
            sb.AppendLine("        this.currentPage = page;                                                                                     ");
            sb.AppendLine("        this.$emit(\"update:current\", page);                                                                        ");
            sb.AppendLine("        this.$emit(\"on-change\", page);                                                                             ");
            sb.AppendLine("        this.initdata();                                                                                             ");
            sb.AppendLine("      }                                                                                                              ");
            sb.AppendLine("    },                                                                                                               ");
            sb.AppendLine("    onSize(pageSize) {                                                                                               ");
            sb.AppendLine("      this.pageSize = pageSize;                                                                                      ");
            sb.AppendLine("      this.$emit(\"on-page-size-change\", pageSize);                                                                 ");
            sb.AppendLine("      this.changePage(1);                                                                                            ");
            sb.AppendLine("      this.initdata();                                                                                               ");
            sb.AppendLine("    },                                                                                                               ");
            sb.AppendLine("    addFrom() {                                                                                                      ");
            sb.AppendLine("      this.showmodal = true;                                                                                         ");
            sb.AppendLine("      this.mprops.hidefooter = false;                                                                                ");
            sb.AppendLine("      this.mprops.title = \"新增\";                                                                                  ");
            sb.AppendLine("      this.mprops.keyId = null;                                                                                      ");
            sb.AppendLine("    },                                                                                                               ");
            sb.AppendLine("    editFrom(index) {                                                                                                ");
            sb.AppendLine("      this.showmodal = true;                                                                                         ");
            sb.AppendLine("      this.mprops.title = \"编辑\";                                                                                  ");
            sb.AppendLine("      this.mprops.hidefooter = false;                                                                                ");
            sb.AppendLine("      this.mprops.index = index;                                                                                     ");
            sb.AppendLine("      this.mprops.keyId = this.tabledata[index][this.tablekey];                                                      ");
            sb.AppendLine("    },                                                                                                               ");
            sb.AppendLine("    remove(index) {                                                                                                  ");
            sb.AppendLine("      axios                                                                                                          ");
            sb.AppendLine("        .request({                                                                                                   ");
            sb.AppendLine("          url: `${this.baseuri}?${this.tablekey}=` + this.tabledata[index][this.tablekey],                                         ");
            sb.AppendLine("          method: \"delete\",                                                                                        ");
            sb.AppendLine("        })                                                                                                           ");
            sb.AppendLine("        .then((res) => {                                                                                             ");
            sb.AppendLine("          if (res.data.code === 200) {                                                                               ");
            sb.AppendLine("            this.tabledata.splice(index, 1);                                                                         ");
            sb.AppendLine("          } else {                                                                                                   ");
            sb.AppendLine("            this.$Message.error({                                                                                    ");
            sb.AppendLine("              content: res.data.msg,                                                                                 ");
            sb.AppendLine("              duration: 2,                                                                                           ");
            sb.AppendLine("              closable: true,                                                                                        ");
            sb.AppendLine("              onClose: () => {                                                                                       ");
            sb.AppendLine("                this.btnloading = false;                                                                             ");
            sb.AppendLine("              },                                                                                                     ");
            sb.AppendLine("            });                                                                                                      ");
            sb.AppendLine("          }                                                                                                          ");
            sb.AppendLine("        })                                                                                                           ");
            sb.AppendLine("        .catch((error) => {                                                                                          ");
            sb.AppendLine("          console.log(error);                                                                                        ");
            sb.AppendLine("        })                                                                                                           ");
            sb.AppendLine("        .finally((x) => {                                                                                            ");
            sb.AppendLine("          this.loading = false;                                                                                      ");
            sb.AppendLine("        });                                                                                                          ");
            sb.AppendLine("    },                                                                                                               ");
            sb.AppendLine("    initdata() {                                                                                                     ");
            sb.AppendLine("      this.loading = true;                                                                                           ");
            sb.AppendLine("      axios                                                                                                          ");
            sb.AppendLine("        .request({                                                                                                   ");
            sb.AppendLine("          url: `${this.baseuri}/query`,                                                                              ");
            sb.AppendLine("          method: \"post\",                                                                                          ");
            sb.AppendLine("          data: {                                                                                                    ");
            sb.AppendLine("            page: this.currentPage,                                                                                  ");
            sb.AppendLine("            pageSize: this.pageSize,                                                                                 ");
            sb.AppendLine("          },                                                                                                         ");
            sb.AppendLine("        })                                                                                                           ");
            sb.AppendLine("        .then((res) => {                                                                                             ");

            sb.AppendLine("          if (res.data.data.data == null) {                                                                       ");
            sb.AppendLine("          this.tabledata = [];                                                                       ");
            sb.AppendLine("          this.totals = 0;                                                                       ");
            sb.AppendLine("          } else {                                                                       ");
            sb.AppendLine("          this.tabledata = res.data.data.data;                                                                       ");
            sb.AppendLine("          this.totals = res.data.data.total;                                                                         ");
            sb.AppendLine("          }                                                                         ");

            sb.AppendLine("        })                                                                                                           ");
            sb.AppendLine("        .catch((error) => {                                                                                          ");
            sb.AppendLine("          console.log(error);                                                                                        ");
            sb.AppendLine("        })                                                                                                           ");
            sb.AppendLine("        .finally((x) => {                                                                                            ");
            sb.AppendLine("          this.loading = false;                                                                                      ");
            sb.AppendLine("        });                                                                                                          ");
            sb.AppendLine("    },                                                                                                               ");
            sb.AppendLine("    modalCancel(data) {                                                                                              ");
            sb.AppendLine("      this.showmodal = false;                                                                                        ");
            sb.AppendLine("      if (data.isok) {                                                                                               ");
            sb.AppendLine("        if (data.index > -1) {                                                                                       ");
            sb.AppendLine("          this.$set(this.tabledata, data.index, data.dataFrom);                                                      ");
            sb.AppendLine("        } else {                                                                                                     ");
            sb.AppendLine("          this.reload();                                                                                             ");
            sb.AppendLine("        }                                                                                                            ");
            sb.AppendLine("      }                                                                                                              ");
            sb.AppendLine("      setTimeout(() => {                                                                                             ");
            sb.AppendLine("        this.mprops.hidefooter = false;                                                                              ");
            sb.AppendLine("      }, 500);                                                                                                       ");
            sb.AppendLine("    },                                                                                                               ");
            sb.AppendLine("  },                                                                                                                 ");
            sb.AppendLine("};                                                                                                                   ");
            sb.AppendLine("</script>                                                                                                            ");
            sb.AppendLine("<style scoped>                                                                                                       ");
            sb.AppendLine(".ivu-row {                                                                                                           ");
            sb.AppendLine("  margin-bottom: 10px;                                                                                               ");
            sb.AppendLine("}                                                                                                                    ");
            sb.AppendLine(".mb10 {                                                                                                              ");
            sb.AppendLine("  margin-bottom: 10px;                                                                                               ");
            sb.AppendLine("}                                                                                                                    ");
            sb.AppendLine(".ml10 {                                                                                                              ");
            sb.AppendLine("  margin-left: 10px;                                                                                                 ");
            sb.AppendLine("}                                                                                                                    ");
            sb.AppendLine(".ml5 {                                                                                                               ");
            sb.AppendLine("  margin-left: 5px;                                                                                                  ");
            sb.AppendLine("}                                                                                                                    ");
            sb.AppendLine(".card {                                                                                                              ");
            sb.AppendLine("  background-color: #fff;                                                                                            ");
            sb.AppendLine("  margin-top: 10px;                                                                                                  ");
            sb.AppendLine("  padding: 15px;                                                                                                     ");
            sb.AppendLine("  border-radius: 5px;                                                                                                ");
            sb.AppendLine("}                                                                                                                    ");
            sb.AppendLine(".btngrop {                                                                                                           ");
            sb.AppendLine("  text-align: right;                                                                                                 ");
            sb.AppendLine("  margin-right: 15px !important ;                                                                                    ");
            sb.AppendLine("}                                                                                                                    ");
            sb.AppendLine("</style>                                                                                                             ");
            sb.AppendLine("                                                                                                                     ");
            sb.AppendLine("            return sb.ToString();                                                                                    ");
            sb.AppendLine("        }                                                                                                            ");
            sb.AppendLine("    }                                                                                                                ");
            sb.AppendLine("}                                                                                                                    ");
            return sb.ToString();
        }
    }
}
